package com.mtons.mblog.modules.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * @author 小神灯的火焰
 * 学习文档
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@Entity
@Table(name = "learn_doc")
public class LearnDoc implements Serializable {

	private static final long serialVersionUID = -7333380688709241760L;
	/**
	 * null
	 * default value: null
	 */
	@Id
	@Column(name = "id", nullable = false, length = 32)
	private String id;

	/**
	 * 用户id
	 * default value: null
	 */
	@Column(name = "author_id", nullable = true, length = 32)
	private long authorId;

	/**
	 * 0-内容卡片 1-单词卡片 2-问答卡片
	 * default value: null
	 */
	@Column(name = "doc_type", nullable = true, length = 8)
	private String docType;

	/**
	 * 卡片集类型ID
	 * default value: null
	 */
	@Column(name = "content_type_id", nullable = true, length = 8)
	private String contentTypeId;


	/**
	 * 层级等级
	 * default value: null
	 */
	@Column(name = "level", nullable = true, length = 3)
	private Integer level;

	/**
	 * 父类id
	 * default value: null
	 */
	@Column(name = "parent_id", nullable = true, length = 32)
	private String parentId;

	/**
	 * 状态 0-未生效 1-生效  2-归档
	 * default value: null
	 */
	@Column(name = "status", nullable = true, length = 1)
	private String status;

	/**
	 * 标题
	 * default value: null
	 */
	@Column(name = "title", nullable = true, length = 200)
	private String title;

	/**
	 * 生效日期
	 * default value: null
	 */
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
	@Column(name = "valid_time", nullable = true)
	private java.util.Date validTime;

	/**
	 * 创建时间
	 * default value: null
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
	@Column(name = "create_time", nullable = true)
	private java.util.Date createTime;

	/**
	 * 创建用户
	 * default value: null
	 */
	@Column(name = "create_user", nullable = true, length = 32)
	private long createUser;

	/**
	 * 更新时间
	 * default value: null
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@Column(name = "update_time", nullable = true)
	private java.util.Date updateTime;

	/**
	 * 更新用户id
	 * default value: null
	 */
	@Column(name = "update_user", nullable = true, length = 32)
	private String updateUser;
}
